package com.influxdb.demo.conf;

import com.influxdb.demo.utils.InfluxdbUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Configuration
@Order(value = 1)
public class InfluxdbConf {
    @Value("${spring.influx.url:''}")
    private String influxDBUrl;
    @Value("${spring.influx.user:''}")
    private String userName;

    @Value("${spring.influx.password:''}")
    private String password;

    @Value("${spring.influx.database:''}")
    private String database;

    @Bean
    public InfluxdbUtils influxdbUtils(){
        return new InfluxdbUtils(influxDBUrl,userName,password,database);
    }
}
